package com.xinxing.city.recovery.net;



import com.xinxing.city.recovery.entitys.BaseEntity;
import com.xinxing.city.recovery.entitys.BucketList;
import com.xinxing.city.recovery.entitys.BucketType;
import com.xinxing.city.recovery.entitys.Cabinet;
import com.xinxing.city.recovery.entitys.Catalogs;
import com.xinxing.city.recovery.entitys.Category;
import com.xinxing.city.recovery.entitys.CityDistrict;
import com.xinxing.city.recovery.entitys.CleanOrder;
import com.xinxing.city.recovery.entitys.CleanQRCode;
import com.xinxing.city.recovery.entitys.Company;
import com.xinxing.city.recovery.entitys.HardwareCategory;
import com.xinxing.city.recovery.entitys.LoginCheck;
import com.xinxing.city.recovery.entitys.OwnerInfo;
import com.xinxing.city.recovery.entitys.QRCodeClean;
import com.xinxing.city.recovery.entitys.QrMessage;
import com.xinxing.city.recovery.entitys.RfidDetail;
import com.xinxing.city.recovery.entitys.UpdataApk;
import com.xinxing.city.recovery.entitys.order;

import java.util.List;

import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface ApiServer {
    //查询硬件类型列表
    @GET("/sr-recycling/v1/pub/hardware_category/infos/query")
    Call<BaseEntity<List<HardwareCategory>>> getHardware();
    //回收柜设备登记
    @POST("/sr-recycling/v1/pub/recycling_cabinet/add")
    Call<BaseEntity> cabinetRegister(@Body RequestBody body);
    //查询回收目录
    @GET("/sr-recycling/v1/pub/catalogs/query")
    Call<BaseEntity<List<Catalogs>>> getCatalogs(@Query("level") String level,@Query("withPrice") boolean withPrice);

    //查询回收柜下所有硬件信息
    @GET("/sr-recycling/v1/pub/hardware_regist/cabinet/list")
    Call<BaseEntity<List<Category>>> getHardwareRegist(@Query("cabinetCode") String cabinetCode, @Query("deviceSerialNum") String deviceSerialNum);

    //查询回收柜详细信息
    @GET("/sr-recycling/v1/pub/recycling_cabinet/get")
    Call<BaseEntity<Cabinet>> getRecyclingCabinet(@Query("code") String code);

    //查询回收桶列表
    @GET("/sr-recycling/v1/pub/recycling_bucket/list/query")
    Call<BaseEntity<BucketList>> getBucket(@Query("page") String page, @Query("size") String size, @Query("code") String code);

    //查询城市分公司列表
    @GET("/sr-recycling/v1/pub/city_company/query")
    Call<BaseEntity<List<Company>>> getCompany(@Query("cityName") String cityName);

    //更新回收桶RFIDCode
    @POST("/sr-recycling/v1/pub/recycling_bucket/rRIDCode/update")
    Call<BaseEntity> upRIDCode(@Body RequestBody body);

    //生成清运二维码
    @POST("/sr-recycling/v1/03/clean/qrcode/gen")
    Call<BaseEntity<QRCodeClean>> cleanScan(@Body RequestBody body);

    //检查清运二维码结果
    @GET("/sr-recycling/v1/03/clean/qrcode/check")
    Call<BaseEntity<CleanQRCode>> getCleanScan(@Query("qrcode") String qrcode);

    //查询清运订单信息
    @GET("/sr-recycling/v1/03/clean/clean_order/get")
    Call<BaseEntity<CleanOrder>> getCleanOrder(@Query("code") String rfidCode);

    //开始清运回收桶
    @POST("/sr-recycling/v1/03/clean/bucket/clean")
    Call<BaseEntity> cleanBucket(@Body RequestBody body);
    //更新回收桶信息
    @POST("/sr-recycling/v1/pub/recycling_bucket/update")
    Call<BaseEntity> updataBucket(@Body RequestBody body);

    @POST("/sr-recycling/v1/pub/recycling_bucket/add")
    Call<BaseEntity<String>> addBucket(@Body RequestBody body);

    @GET("/sr-recycling/v1/pub/ownerInfo/get")
    Call<BaseEntity<OwnerInfo>> getOwnerInfo();

    //根据城市行政区划编码查询区县开通列表
    @GET("/sr-recycling/v1/pub/operating/county/city_district/query")
    Call<BaseEntity<List<CityDistrict>>> getCityDistrict(@Query("districtCode") String districtCode);

    @GET("/sr-recycling/v1/pub/operating/boundary_zone/county_district/query")
    Call<BaseEntity<List<CityDistrict>>> getCountyDistrict(@Query("districtCode") String districtCode);

    @POST("/sr-recycling/v1/01/recycle/trad_order/create")
    Call<BaseEntity<order>> orderCreate(@Body RequestBody body);
    //生成小程序登录二维码
    @POST("/sr-cas/v1/auth/login/qrcode/mini/gen")
    Call<BaseEntity<QrMessage>> getQrcode(@Body RequestBody body);

    @GET("/sr-cas/v1/auth/login/qrcode/check")
    Call<BaseEntity<LoginCheck>> getLoginCheck(@Query("loginCode") String loginCode);
    //称重完成
    @POST("/sr-recycling/v1/01/recycle/trad_order/weight/completed")
    Call<BaseEntity<order>> subOrder(@Body RequestBody body);
    //选择回收品类
    @POST("/sr-recycling/v1/01/recycle/trad_order/catatype/select")
    Call<BaseEntity> subCatatype(@Body RequestBody body);

    @POST("/sr-recycling/v1/01/recycle/trad_order/status/update")
    Call<BaseEntity> subOrderStatus(@Body RequestBody body);
    //查询应用最新版本
    @GET("/sr-appstore/v1/apps/releases/latest")
    Call<BaseEntity<UpdataApk>> getUpdataApk(@Query("appID") String appID,@Query("platform") String platform,@Query("currentVersion") String currentVersion);
    //上报回收柜信息(定时上报5分钟上报一次)
    @POST("/sr-recycling/v1/pub/info_report")
    Call<BaseEntity> sendHeartbeat(@Body RequestBody body);
    @GET("/sr-recycling/v1/pub/codes/rb/detail")
    Call<BaseEntity<RfidDetail>> getRfidDetail(@Query("code") String code);
}
